/***************************************************************************
 *   Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN  *
 *   {prenom.nom}_at_lip6.fr                                                  *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#include <vector>
#include <list>
#include <agrum/core/list.h>
#include <agrum/core/types.h>
#include <agrum/core/exceptions.h>
#include <agrum/learning/database.h>
#include <agrum/core/debug.h>
#include <agrum/learning/InstantiationBoxTools.h>

#ifdef GUM_NO_INLINE
#include <agrum/learning/InstantiationBoxTools.inl>
#endif /* GUM_NO_INLINE */
namespace gum{
	vector<unsigned int>& InstantiationBoxParent::getAllDbCases()
	{
		vector<unsigned int> * cases=new vector<unsigned int>();
		unsigned int sizeCase=0;
		unsigned int deb=0;
		for(unsigned int i=0;i<__dbCases->size();++i)
		{
			sizeCase+=__dbCases->operator[](i).size();
			cases->resize(sizeCase);
			for(unsigned int j=deb;j<sizeCase;++j)
			{
				cases->push_back(__dbCases->operator[](i)[j-deb]);
			}			
			deb=sizeCase;	
		}
		return *cases;
	}
}
